package com.mr.model;

import java.sql.Timestamp;

import org.hibernate.validator.constraints.NotEmpty;

import com.mr.util.DateUtil;
public class News extends BaseObject{
	private static final long serialVersionUID = 969873436100682067L;
	private Long id;
	private Long relatedid;
	@NotEmpty(message="名称不能为空！")
	private String name;
	private String content;
	private String status;
	private Timestamp addtime;
	public News(){
		this.addtime = DateUtil.getCurTimestamp();
		this.status = Status.Y;
	}
	public News(Long id, String name,String status){
		this.id = id;
		this.name = name;
		this.status = status;
	}
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getRelatedid() {
		return relatedid;
	}

	public void setRelatedid(Long relatedid) {
		this.relatedid = relatedid;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public Timestamp getAddtime() {
		return addtime;
	}

	public void setAddtime(Timestamp addtime) {
		this.addtime = addtime;
	}

	public boolean equals(Object o) {
		if (this == o)
			return true;
		if (!(o instanceof News))
			return false;

		final News temp = (News) o;

		return !(this.getId() != null ? !(this.getId().equals(temp.getId()))
				: (temp.getId() != null));

	}

	public int hashCode() {
		return (this.getId() != null ? this.getId().hashCode() : 0);
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

}
